function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i = 0; i < vars.length; i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			return pair[1];
		}
	}
	return '';
}
function cloneLoop(arr) {
	var root = {}
	var loopList = [{
		parent: root,
		key: undefined,
		data: arr
	}]
	while (loopList.length) {
		var node = loopList.pop()
		var parent = node.parent
		var key = node.key
		var data = node.data
		var res = parent
		if (typeof key !== 'undefined') {
			res = parent[key] = {}
		}
		for (var k in data) {
			if (data.hasOwnProperty(k)) {
				if (typeof data[k] === 'object') {
					loopList.push({
						parent: res,
						key: k,
						data: data[k]
					})
				} else {
					res[k] = data[k]
				}
			}
		}
	}
	return root
}